USE [RD_ARMart]
GO

/****** Object:  Index [PK_AR_Star_Facts]    Script Date: 08/17/2010 19:49:09 ******/
ALTER TABLE [dbo].[AR_Star_Facts] ADD  CONSTRAINT [PK_AR_Star_Facts] PRIMARY KEY CLUSTERED 
(
	[DocumentNumber] ASC,
	[DocumentType] ASC,
	[PayItem] ASC,
	[DocumentCompany] ASC,
	[InternalPaymentID] ASC,
	[FileLineIdentifier] ASC,
	[InvoiceType] ASC,
	[PayItemExtensionNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO


USE [RD_ARMart]
GO

/****** Object:  Index [IX_Facts_BatchDate]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_BatchDate] ON [dbo].[AR_Star_Facts] 
(
	[BatchDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_BillToNumber]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_BillToNumber] ON [dbo].[AR_Star_Facts] 
(
	[BillToNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_BusinessUnitID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_BusinessUnitID] ON [dbo].[AR_Star_Facts] 
(
	[BusinessUnitID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_CheckItemDate]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_CheckItemDate] ON [dbo].[AR_Star_Facts] 
(
	[CheckItemDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_CompanyID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_CompanyID] ON [dbo].[AR_Star_Facts] 
(
	[CompanyNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_CustomerNumberID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_CustomerNumberID] ON [dbo].[AR_Star_Facts] 
(
	[CustomerNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_DateClosed]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_DateClosed] ON [dbo].[AR_Star_Facts] 
(
	[DateClosedID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_DateInvPrinted]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_DateInvPrinted] ON [dbo].[AR_Star_Facts] 
(
	[DateInvoicePrintedID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_DeductionActivityCodeID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_DeductionActivityCodeID] ON [dbo].[AR_Star_Facts] 
(
	[DeductionActivityCodeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_DiscountDueDate]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_DiscountDueDate] ON [dbo].[AR_Star_Facts] 
(
	[DiscountDueDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_DocumentID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_DocumentID] ON [dbo].[AR_Star_Facts] 
(
	[DocumentID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_DueDate]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_DueDate] ON [dbo].[AR_Star_Facts] 
(
	[DueDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_FactsExtID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_FactsExtID] ON [dbo].[AR_Star_Facts] 
(
	[FactsExtID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_GLDate]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_GLDate] ON [dbo].[AR_Star_Facts] 
(
	[GLDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_GLVoidDate]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_GLVoidDate] ON [dbo].[AR_Star_Facts] 
(
	[GLVoidDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_InternalPaymentID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_InternalPaymentID] ON [dbo].[AR_Star_Facts] 
(
	[InternalPaymentID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_InvoiceDate]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_InvoiceDate] ON [dbo].[AR_Star_Facts] 
(
	[InvoiceDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_InvoiceType]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_InvoiceType] ON [dbo].[AR_Star_Facts] 
(
	[InvoiceType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_PaymentTermsID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_PaymentTermsID] ON [dbo].[AR_Star_Facts] 
(
	[PaymentTermsID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_SalesDocTypeSource]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_SalesDocTypeSource] ON [dbo].[AR_Star_Facts] 
(
	[OMSConfirmNumber] ASC,
	[SalesDocumentType] ASC,
	[SourceID] ASC,
	[PayItem] ASC
)
INCLUDE ( [BatchDateID]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_SalesDocumentNumber]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_SalesDocumentNumber] ON [dbo].[AR_Star_Facts] 
(
	[SalesDocumentNumber] ASC,
	[CustomerNumberID] ASC,
	[PayStatus] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Facts_TypeID]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_Facts_TypeID] ON [dbo].[AR_Star_Facts] 
(
	[TypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_OrderSuffix]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [IX_OrderSuffix] ON [dbo].[AR_Star_Facts] 
(
	[OrderSuffix] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_109]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [missing_index_109] ON [dbo].[AR_Star_Facts] 
(
	[CheckNumber] ASC
)
INCLUDE ( [CustomerNumberID],
[AmountPaid]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_452]    Script Date: 08/17/2010 19:49:04 ******/
CREATE NONCLUSTERED INDEX [missing_index_452] ON [dbo].[AR_Star_Facts] 
(
	[PayStatus] ASC
)
INCLUDE ( [FactsExtID],
[CustomerNumberID],
[PaymentTermsID],
[GrossAmount],
[TransactionOpenAmount],
[InvoiceDateID],
[DueDateID],
[DocumentTypeJE],
[OpenAmount],
[SalesDocumentNumber]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO


